/*
 * @Description: In User Settings Edit
 * @Author: your name
 * @LastEditors: Please set LastEditors
 * @Date: 2019-05-08 11:41:56
 * @LastEditTime: 2019-06-26 16:48:37
 */

import {
    config
} from "../config.js";
import {
    HTTP
} from "../utils/https.js";

class Data extends HTTP {
    /**
     * @description: 获取基本信息
     */
    getBaseConfig() {
        return this.request({
            url: config.getBaseConfig,
            hastoken: 0
        })
    }

    /**
     * @description: 获取附近商铺
     * @param {latitude,longitude} 
     */
    getShopsList(latitude, longitude) {
        return this.request({
            url: config.getShops,
            data: {
                latitude,
                longitude
            },
            hastoken: 0
        })
    }

    /**
     * @description: 加载所有商品
     * @param {shopid} 
     */
    getMenuListAll(shopid) {
        return this.request({
            url: config.getMenuListAll,
            data: {
                shopid
            },
            hastoken: 0
        })
    }

    /**
     * @description: 加载菜品的规格
     * @param {type} 
     */
    getSkuList(gid) {
        return this.request({
            url: config.getSkuList,
            data: {
                gid
            }
        })
    }

    /**
     * @description:  商品图片预览
     */
    getFooPicPreview(gid) {
        return this.request({
            url: config.getFooPicPreview,
            data: {
                gid
            },
            hastoken: 0
        })
    }

    /**
     * @description:  获的备选热词
     */
    getHotWord() {
        return this.request({
            url: config.getHotWord,
        })
    }

    /**
     * @description: 充值配置信息
     */
    getRechargeConfig() {
        return this.request({
            url: config.getRechargeConfig
        })
    }

    /**
     * @description:  加载积分商城的产品列表
     */
    getIntegralGoods(page) {
        return this.request({
            url: config.getIntegralGoods,
            data: {
                page: page
            },
            hastoken: 0
        })
    }

    /**
     * @description: 加载积分商城的slider
     */
    getIntegralSlider() {
        return this.request({
            url: config.getIntegralSlider,
            hastoken: 0
        })
    }

    /**
     * @description: 获取店铺信息
     */
    getShopInfo(id) {
        return this.request({
            url: config.getShopInfo,
            data: {
                id
            },
            hastoken: 0
        })
    }





}

export {
    Data
}